package org.lds.scheduled.job.admin.business.worker.model.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.lds.scheduled.job.common.model.db.request.BaseUpdateRequest;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 更新 - 请求
 *
 * @author lidongsheng
 * @since 2025-01-16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class WorkerBaseUpdateRequest extends BaseUpdateRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @NotNull(message = "id不能为空")
    private Long id;


    /**
     * 应用ID
     */
    private Long appId;


    /**
     * IP
     */
    private String ip;


    public void setIp(String ip) {
        this.ip = StringUtils.trimToNull(ip);
    }

    /**
     * 端口
     */
    private Integer port;


    /**
     * 状态
     */
    private Boolean enable;


}
